<div class="content_box">
  <h1>Campeonatos</h1>
  <div class="right_corner">
    <a class="contentbox_btn" href="<?php echo url_for('tournament/new') ?>">Novo</a>
  </div>
  <div class="content">
  <?php $tournamentsByYear = BolaoTournamentPeer::organizeByYear($tournaments) ?>
  <?php foreach($tournamentsByYear as $year => $tournaments): ?>
    <h2><?php echo $year ?></h2>
    <ul>
    <?php foreach($tournaments as $tournament): ?>
      <li><a href="<?php echo url_for('@show_tournament_by_name?year='.$tournament->getYear().'&name_slug='.$tournament->getNameSlug().'&category_slug='.$tournament->getBolaoSubcategory()->getCategory()->getNameSlug().'&subcategory_slug='.$tournament->getBolaoSubcategory()->getNameSlug()) ?>"><?php echo $tournament->getName() ?> (<?php echo $tournament->getBolaoSubcategory() ?>)</a></li>
    <?php endforeach; ?>
    </ul>
  <?php endforeach; ?>
  </div>
</div>
